function cpwd(){
	var username=$("#cpwd").find("input:eq(0)").val()
	var oldpassword=$("#cpwd").find("input:eq(1)").val()
	var newpassword=$("#cpwd").find("input:eq(2)").val()
	var pwd=$("#cpwd").find("input:eq(3)").val()
	if(username==null||username==''){
		layer.msg('用户名不能为空');
        return; 
	 }
	if(oldpassword==null||oldpassword==''){
		layer.msg('密码不能为空');
        return; 
	 }
	if(newpassword==null||newpassword==''){
		layer.msg('请填写新密码');
        return; 
	 }
	if(pwd==null||pwd==''){
		layer.msg('确认密码');
        return; 
	 }
	$.ajax({
		url:'/user/updatepwd',
		type:'post',
		data:{'username':username,'oldpassword':oldpassword,'newpassword':newpassword,'pwd':pwd},
		dataType:'json',
		success:function(res){
			if(res.success){
				layer.msg('修改成功')
				window.location.reload()
			}
			else{
				layer.msg(res.msg);
			}
		},
		error:function(){
			layer.msg('连接失败')
		}
		
	})
}